<?php
namespace app\admin\controller;
use app\admin\controller\Base;
class Article extends Base
{
    public function index()
    {
        return view();
    }
    public function edit()
    {
        return view();
    }
    function catchToQiniu(){
        $ret= catchToQiniu($_POST['srcs'],$_POST['path']);
        echo json_encode($ret,true);
    }
	function autosave(){
		$_POST['id']=-1;
        $ret=parent::update();
		$this->success('ok');
    }
    function analysistags(){
        $body = Input('title').Input('content','','strip_tags,html_entity_decode');
        $pa = new \Phpanalysis\Phpanalysis('utf-8', 'utf-8', true);
        //载入词典
        $pa->LoadDict();
        //执行分词
        $pa->SetSource($body);
        $pa->differMax = true;
        $pa->unitWord = true;
        $pa->SetResultType(2);
        $pa->notSplitLen   = 2;
        $pa->differFreq = true;
        $pa->StartAnalysis( true );
        $res = $pa->GetFinallyKeywords(10);
        echo $res;/*
        $res = explode(',',$res);
        p($res);*/
    }
}
